You are here: Symbol Reference > dtSearch.Engine Namespace > Classes > SearchResults Class > SearchResults Methods > AddDocs Method
Close
dtSearch .NET Standard API 2024.02
SearchResults.AddDocs Method

Add documents to SearchResults.

public void AddDocs( string indexPath, int[] docIds );
Parameters
Description
indexPath
Path of the index that contains the documents.
docIds
Document ids of the documents to add.

When adding more than one document to SearchResults, AddDocs is faster than AddDoc because the index is only opened once. 

SearchResults.AddDocs can be used to convert a SearchFilter to a SearchResults object containing the same documents. First call SearchFilter.GetItems() to get an array the of document ids in the SearchFilter, and then call SearchResults.AddDocs() to add the document ids to a SearchResults object. Example:

private SearchResults ConvertFilterToResults(SearchFilter filter, int iIndex) { int[] docIds = filter.GetItems(iIndex); SearchResults results = new SearchResults(); results.AddDocs(filter.getIndexPath(iIndex), docIds); return results; }
Copyright (c) 1998-2023 dtSearch Corp. All rights reserved.